package com.ruoyi.smile.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.smile.mapper.McDynamicCommentMapper;
import com.ruoyi.smile.domain.McDynamicComment;
import com.ruoyi.smile.service.IMcDynamicCommentService;

/**
 * 动态评论Service业务层处理
 *
 * @author xin
 * @date 2025-03-22
 */
@Service
public class McDynamicCommentServiceImpl implements IMcDynamicCommentService
{
    @Autowired
    private McDynamicCommentMapper mcDynamicCommentMapper;

    /**
     * 查询动态评论
     *
     * @param id 动态评论主键
     * @return 动态评论
     */
    @Override
    public McDynamicComment selectMcDynamicCommentById(Long id)
    {
        return mcDynamicCommentMapper.selectMcDynamicCommentById(id);
    }

    /**
     * 查询动态评论列表
     *
     * @param mcDynamicComment 动态评论
     * @return 动态评论
     */
    @Override
    public List<McDynamicComment> selectMcDynamicCommentList(McDynamicComment mcDynamicComment)
    {
        return mcDynamicCommentMapper.selectMcDynamicCommentList(mcDynamicComment);
    }

    /**
     * 新增动态评论
     *
     * @param mcDynamicComment 动态评论
     * @return 结果
     */
    @Override
    public int insertMcDynamicComment(McDynamicComment mcDynamicComment)
    {
        mcDynamicComment.setCreateTime(DateUtils.getNowDate());
        return mcDynamicCommentMapper.insertMcDynamicComment(mcDynamicComment);
    }

    /**
     * 修改动态评论
     *
     * @param mcDynamicComment 动态评论
     * @return 结果
     */
    @Override
    public int updateMcDynamicComment(McDynamicComment mcDynamicComment)
    {
        return mcDynamicCommentMapper.updateMcDynamicComment(mcDynamicComment);
    }

    /**
     * 批量删除动态评论
     *
     * @param ids 需要删除的动态评论主键
     * @return 结果
     */
    @Override
    public int deleteMcDynamicCommentByIds(Long[] ids)
    {
        return mcDynamicCommentMapper.deleteMcDynamicCommentByIds(ids);
    }

    /**
     * 删除动态评论信息
     *
     * @param id 动态评论主键
     * @return 结果
     */
    @Override
    public int deleteMcDynamicCommentById(Long id)
    {
        return mcDynamicCommentMapper.deleteMcDynamicCommentById(id);
    }
}
